<div class="panelBar">
	<ul class="toolBar">
		<li><a class="add" href="javascript:;" url="entity/add_comment.html?entity_id={entity_id}&&entity={entity}" target="dialog" rel="addComment" mask="true" callback="comment" title="添加评论" width="700" height="500"><span>添加评论</span></a></li>
		<li><a class="delete" url="/comment/{comment_id}" area="tbody.list" callback="$this.parents('.panelBar').next().find('>table.list').removeAttr('loaded').jBinds()" type="delete" target="navTabTodo" title="确定要删除选中的数据吗？" warn="请选择需要删除的数据项！"><span>删除</span></a></li>
	</ul>
</div>
<div class="tableList">
	<table class="list" width="100%">
		<thead>
			<tr>
				<th width="25"><input type="checkbox" name="objectId" value="comment_id"/></th>
				<th width="30">编号</th>
				<th width="120">名称</th>
				<th width="60">是否已读</th>
				<th>内容</th>
				<th width="70">用户名</th>
				<th width="125">创建日期</th>
				<th width="60">操作</th>
			</tr>
		</thead>
		<tbody class="templet">
			<tr comment_id="${comment_id}" put="/comment/${comment_id}">
				<td><input type="checkbox" name="comment_id" value="${comment_id}" /></td>
				<td>${num}</td>
				<td class="edit" field="title" validator="required">${title}</td>
				<td class="edit" field="readed" >${readed}</td>
				<td class="edit" field="content" validator="required">${content}</td>
				<td title="${username}">${user_name}</td>
				<td title="${create_date}">${create_date}</td>
				<td>
					<a class="edit" name="show" warn="非法参数（${entity_id}）"
						target="ajax"
						href="entity/reply.html?comment_id=${comment_id}"
						rel="comment${comment_id}"
						callback="$this.next('a[name=hide]').show();$this.hide();$this.removeAttr('href');"><span>查看回复</span>
					</a>
					<a class="edit" name="hide" href="javascript:void(0);"
						style="display: none;"
						onclick="$(this).parents('tr[comment_id=${comment_id}]').next('tr[parentComment=${comment_id}]').hide();$(this).prev('a[name=show]').show();$(this).hide();"><span>收起</span>
					</a>
				</td>
			</tr>
			<tr parentComment="${comment_id}" class="hide">
				<td colspan="7" align="right" id="comment${comment_id}" class="shade" style="padding-bottom: 2px;">

				</td>
			</tr>
		</tbody>
		<tbody class="list" action="{entity}/{entity_id}/comment">
		</tbody>
	</table>
</div>
<script>
function comment(data,jDom){
	if(!data||data.length==0) return;
	var tb = jDom.parents('.panelBar').next().find('>table.list');
	var url = $("tbody.list",tb).attr("action");
	DWZ.get(url,function(){
		tb.removeAttr('loaded').jBinds();
	})
}
</script>